package com.dragon.modules.yuegou.query.coupon;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.coupon.CouponPackageEntity;
import com.dragon.modules.yuegou.enums.OwnerType;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 券包（会员券包，不冗余券包模板信息，请使用1+N模式查询） 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-02-28 18:30:17
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class CouponPackageQuery extends CouponPackageEntity implements Query<CouponPackageEntity> {

    /** 券包ID查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 举]所有者类型(把券包交给会员之前的所有者)查询条件 */
	@JsonUnwrapped(prefix = "ownerType")
	private Condition<OwnerType> ownerTypeCondition;

    /** 集团ID查询条件 */
	@JsonUnwrapped(prefix = "groupId")
	private Condition<String> groupIdCondition;

    /** 商圈ID查询条件 */
	@JsonUnwrapped(prefix = "businessDistrictId")
	private Condition<String> businessDistrictIdCondition;

    /** 商户ID查询条件 */
	@JsonUnwrapped(prefix = "merchantId")
	private Condition<String> merchantIdCondition;

    /** 会员ID查询条件 */
	@JsonUnwrapped(prefix = "memberId")
	private Condition<String> memberIdCondition;

    /** 券包模板ID查询条件 */
	@JsonUnwrapped(prefix = "couponPackageTemplateId")
	private Condition<String> couponPackageTemplateIdCondition;

    /** 获取时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public CouponPackageQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public CouponPackageQuery(CouponPackageEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public CouponPackageQuery(CouponPackageQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.ownerTypeCondition != null) {
			this.ownerTypeCondition = other.ownerTypeCondition.copy();
		}
		if(other.groupIdCondition != null) {
			this.groupIdCondition = other.groupIdCondition.copy();
		}
		if(other.businessDistrictIdCondition != null) {
			this.businessDistrictIdCondition = other.businessDistrictIdCondition.copy();
		}
		if(other.merchantIdCondition != null) {
			this.merchantIdCondition = other.merchantIdCondition.copy();
		}
		if(other.memberIdCondition != null) {
			this.memberIdCondition = other.memberIdCondition.copy();
		}
		if(other.couponPackageTemplateIdCondition != null) {
			this.couponPackageTemplateIdCondition = other.couponPackageTemplateIdCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<CouponPackageEntity> toQueryWrapper() {
		QueryWrapper<CouponPackageEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (ownerTypeCondition != null) {
			ownerTypeCondition.toWrapper(wrapper, COL_OWNER_TYPE);
		}
		if (groupIdCondition != null) {
			groupIdCondition.toWrapper(wrapper, COL_GROUP_ID);
		}
		if (businessDistrictIdCondition != null) {
			businessDistrictIdCondition.toWrapper(wrapper, COL_BUSINESS_DISTRICT_ID);
		}
		if (merchantIdCondition != null) {
			merchantIdCondition.toWrapper(wrapper, COL_MERCHANT_ID);
		}
		if (memberIdCondition != null) {
			memberIdCondition.toWrapper(wrapper, COL_MEMBER_ID);
		}
		if (couponPackageTemplateIdCondition != null) {
			couponPackageTemplateIdCondition.toWrapper(wrapper, COL_COUPON_PACKAGE_TEMPLATE_ID);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回券包ID查询条件
	 * 
	 * @return idCondition 券包ID查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取券包ID查询条件
	 * 
	 * @return idCondition 券包ID查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置券包ID查询条件
	 * 
	 * @param idCondition 券包ID查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回举]所有者类型(把券包交给会员之前的所有者)查询条件
	 * 
	 * @return ownerTypeCondition 举]所有者类型(把券包交给会员之前的所有者)查询条件
	 */
	public Condition<OwnerType> ownerType() {
		this.ownerTypeCondition = new Condition<>();
		return this.ownerTypeCondition;
	}
	
	/**
	 * 获取举]所有者类型(把券包交给会员之前的所有者)查询条件
	 * 
	 * @return ownerTypeCondition 举]所有者类型(把券包交给会员之前的所有者)查询条件
	 */
	public Condition<OwnerType> getOwnerTypeCondition() {
		return ownerTypeCondition;
	}

	/**
	 * 设置举]所有者类型(把券包交给会员之前的所有者)查询条件
	 * 
	 * @param ownerTypeCondition 举]所有者类型(把券包交给会员之前的所有者)查询条件
	 */
	public void setOwnerTypeCondition(Condition<OwnerType> ownerTypeCondition) {
		this.ownerTypeCondition = ownerTypeCondition;
	}

	/**
	 * 构造并返回集团ID查询条件
	 * 
	 * @return groupIdCondition 集团ID查询条件
	 */
	public Condition<String> groupId() {
		this.groupIdCondition = new Condition<>();
		return this.groupIdCondition;
	}
	
	/**
	 * 获取集团ID查询条件
	 * 
	 * @return groupIdCondition 集团ID查询条件
	 */
	public Condition<String> getGroupIdCondition() {
		return groupIdCondition;
	}

	/**
	 * 设置集团ID查询条件
	 * 
	 * @param groupIdCondition 集团ID查询条件
	 */
	public void setGroupIdCondition(Condition<String> groupIdCondition) {
		this.groupIdCondition = groupIdCondition;
	}

	/**
	 * 构造并返回商圈ID查询条件
	 * 
	 * @return businessDistrictIdCondition 商圈ID查询条件
	 */
	public Condition<String> businessDistrictId() {
		this.businessDistrictIdCondition = new Condition<>();
		return this.businessDistrictIdCondition;
	}
	
	/**
	 * 获取商圈ID查询条件
	 * 
	 * @return businessDistrictIdCondition 商圈ID查询条件
	 */
	public Condition<String> getBusinessDistrictIdCondition() {
		return businessDistrictIdCondition;
	}

	/**
	 * 设置商圈ID查询条件
	 * 
	 * @param businessDistrictIdCondition 商圈ID查询条件
	 */
	public void setBusinessDistrictIdCondition(Condition<String> businessDistrictIdCondition) {
		this.businessDistrictIdCondition = businessDistrictIdCondition;
	}

	/**
	 * 构造并返回商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> merchantId() {
		this.merchantIdCondition = new Condition<>();
		return this.merchantIdCondition;
	}
	
	/**
	 * 获取商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> getMerchantIdCondition() {
		return merchantIdCondition;
	}

	/**
	 * 设置商户ID查询条件
	 * 
	 * @param merchantIdCondition 商户ID查询条件
	 */
	public void setMerchantIdCondition(Condition<String> merchantIdCondition) {
		this.merchantIdCondition = merchantIdCondition;
	}

	/**
	 * 构造并返回会员ID查询条件
	 * 
	 * @return memberIdCondition 会员ID查询条件
	 */
	public Condition<String> memberId() {
		this.memberIdCondition = new Condition<>();
		return this.memberIdCondition;
	}
	
	/**
	 * 获取会员ID查询条件
	 * 
	 * @return memberIdCondition 会员ID查询条件
	 */
	public Condition<String> getMemberIdCondition() {
		return memberIdCondition;
	}

	/**
	 * 设置会员ID查询条件
	 * 
	 * @param memberIdCondition 会员ID查询条件
	 */
	public void setMemberIdCondition(Condition<String> memberIdCondition) {
		this.memberIdCondition = memberIdCondition;
	}

	/**
	 * 构造并返回券包模板ID查询条件
	 * 
	 * @return couponPackageTemplateIdCondition 券包模板ID查询条件
	 */
	public Condition<String> couponPackageTemplateId() {
		this.couponPackageTemplateIdCondition = new Condition<>();
		return this.couponPackageTemplateIdCondition;
	}
	
	/**
	 * 获取券包模板ID查询条件
	 * 
	 * @return couponPackageTemplateIdCondition 券包模板ID查询条件
	 */
	public Condition<String> getCouponPackageTemplateIdCondition() {
		return couponPackageTemplateIdCondition;
	}

	/**
	 * 设置券包模板ID查询条件
	 * 
	 * @param couponPackageTemplateIdCondition 券包模板ID查询条件
	 */
	public void setCouponPackageTemplateIdCondition(Condition<String> couponPackageTemplateIdCondition) {
		this.couponPackageTemplateIdCondition = couponPackageTemplateIdCondition;
	}

	/**
	 * 构造并返回获取时间查询条件
	 * 
	 * @return createdTimeCondition 获取时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取获取时间查询条件
	 * 
	 * @return createdTimeCondition 获取时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置获取时间查询条件
	 * 
	 * @param createdTimeCondition 获取时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

}
